package com.ltmonitor.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ltmonitor.dao.IRoleDao;
import com.ltmonitor.entity.Role;
import com.ltmonitor.service.IRoleService;

@Service("roleService")
public class RoleService extends BaseService<Long, Role> implements IRoleService {

	@Autowired
	private IRoleDao RoleDao;
	

	public boolean isRoleAssigned(long roleId)
	{
		String hql = "select 1 from UserInfo u inner join u.roles f where u.deleted=? and f.entityId=? ";
		
		List result = this.query(hql, new Object[] {false, roleId});
		
		return result.size() > 0;

	}
	
	

}
